package com.qd.common.panda.domain.entity.func;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 渠道推广
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class ChannelDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "渠道编码不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 10, message = "渠道编码长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String channelCode;
    /**
     * 渠道名称
     */
    @NotBlank(message = "渠道名称不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 100, message = "渠道名称长度不能超过{max}位", groups = DefaultGroup.class)
    private String channelName;
    /**
     * 联系人
     */
    @Size(max = 100, message = "联系人长度不能超过{max}位", groups = DefaultGroup.class)
    private String contact;
    /**
     * 联系电话
     */
    @Size(max = 20, message = "联系电话长度不能超过{max}位", groups = DefaultGroup.class)
    private String contactPhone;
    /**
     * 备注
     */
    @Size(max = 500, message = "备注长度不能超过{max}位", groups = DefaultGroup.class)
    private String note;
    /**
     * 添加时间
     */
    private LocalDateTime addTime;
    /**
     * 修改时间
     */
    private LocalDateTime updateTime;
    /**
     * 是否启用
     */
    @Size(max = 50, message = "是否启用长度不能超过{max}位", groups = DefaultGroup.class)
    private String enable;
    /**
     * 是否启用显示
     */
    private String enableDisplay;

    @Override
    public void freeData() {
        this.channelCode = null;
        this.channelName = null;
        this.contact = null;
        this.contactPhone = null;
        this.note = null;
        this.addTime = null;
        this.updateTime = null;
        this.enable = null;
        super.freeData();
    }
}
